import { listenerCount } from "process"
import info from "../action/index"
let userlist=[{id:1,name:"lesson",pwd:"123456"},{id:2,name:"lala",pwd:"123456"}]
let userReducer=(state={list:userlist},action:any)=>{
    switch(action.type){
        case info.DELUSER:return {list:state.list.filter(item=>item.id!=action.payload)}
        case info.INITUSERLIST:return {list:action.payload}
        case info.ADDUSER:return {list:[...state.list,action.payload]}
    }

    return state;
}
export default userReducer